package tk.kolesnikov.hashes;

import tk.kolesnikov.algorithms.ImageUtils;

import java.awt.image.BufferedImage;

/**
 * Created by seko0313 on 15.01.14.
 */
public class AHash implements ImageHash {

    public String getHash(BufferedImage image) {
        ImageUtils imageUtils = new ImageUtils();
        image = imageUtils.resize(image, 8, 8);
        image = imageUtils.graysсale(image);
        int averageColor = imageUtils.getAverageColors(image)[1];
        int[][] mask = imageUtils.getAverageMask(image, averageColor);
        return imageUtils.averageMaskToHash(mask);
    }


}
